package com.tg.paw.oms.controller;

import cn.hutool.core.date.DateUtil;
import com.tg.paw.common.generator.IdGeneratorUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.IdGenerator;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * OmsController
 *
 * @author Rubble
 * @date 2020/6/12
 */
@RestController
public class OmsController {

    @Value("${spring.application.name}")
    private String serverName;

    @GetMapping({"/","/welcome"})
    public String welcome(){
        return "welcome to " + serverName +" "+ DateUtil.now();
    }

    @GetMapping("/hello")
    public Object hello(){
        long id = IdGeneratorUtil.nextId();
        return id;
    }
}
